package com.sultan.guante.userSystem.dao.impl;


import java.util.List;

import org.springframework.stereotype.Repository;

import com.sultan.guante.userSystem.dao.UserDAO;
import com.sultan.guante.userSystem.domain.Credential;
import com.sultan.guante.userSystem.domain.Users;

@Repository("UserDAO")
public class UserDAOImpl  extends BaseDAOImpl<Users,Long> implements UserDAO{


	@Override
	public Class<Users> getRelatedEntityClass() {
		return Users.class;
	}
	
	@Override
	public Users getUserByName(String userName) {
		if (userName == null) {
			return null;
		}
		List<Users> list= executeSQLQuery("from Users u where u.firstName='" + userName + "'");
		if (list.size() == 1) {
			return list.get(0);
		}
		return null;
	}

}
